package com.lee.common.widget

import android.content.Context
import android.util.AttributeSet
import com.qmuiteam.qmui.util.QMUIDisplayHelper
import com.xuexiang.xui.utils.DensityUtils
import com.xuexiang.xui.widget.layout.XUIFrameLayout

/**
 * desripbe ShadowFrameLayout
 */
class ShadowFrameLayout : XUIFrameLayout {
    constructor(context: Context?) : super(context) {}
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
        val mRadius =7
        val mShadowElevationDp = 14f
        val mShadowAlpha = 0.25f
        //val mShadowElevation =  DensityUtils.dp2px(3f)
        setRadius(QMUIDisplayHelper.dp2px(context, mRadius))


        setRadiusAndShadow(mRadius,
            DensityUtils.dp2px(getContext(), mShadowElevationDp),
            mShadowAlpha);
        //setRadiusAndShadow(QMUIDisplayHelper.dp2px(context, mRadius),mShadowElevation,0)
        //shadowColor = 0xFFDAE6EF.toInt()
    }

    constructor(
        context: Context?,
        attrs: AttributeSet?,
        defStyleAttr: Int
    ) : super(context, attrs, defStyleAttr) {


    }

   /* private fun change() {
        val mRadius = QMUIDisplayHelper.dp2px(context, 6)
        val mShadowElevation =  QMUIDisplayHelper.dp2px(context, 3)
        setRadiusAndShadow(mRadius,mShadowElevation,255.0f/2)
        shadowColor = 0xFFDAE6EF.toInt()
    }*/
}